<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use App\Models\Originurl;
use App\Handlers\CrawlerUrlsHandler;
use App\Models\CrawlerUrl;
class CrawlerOriginUrls implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $originurl;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($url)
    {
        $this->originurl = $url;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $this->originurl->touch();
        // 获取详情页地址
        $c = new CrawlerUrlsHandler($this->originurl);
        $urls = $c->getList();
    }
}
